package com.java.parallel.threadBand.minsheng;

import java.util.LinkedList;
import java.util.Scanner;

/**
 * @author guoyu
 * @date 2022/12/3
 * @Version 1.0
 * @Description TODO
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        LinkedList res = deal(n, k);
        for (int i = 0; i < res.size(); i++) {
            System.out.print(res.get(i));
        }
    }

    private static LinkedList deal(int n, int k) {
//        int res[] = new int[n];
        LinkedList<Integer> res = new LinkedList();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = i + 1;
        }

        int st = 0;
        int ed = n - 1;
        int tar = n - k - 1;
        while (st < tar) {
            res.addLast(nums[st]);
            st++;
        }
        while (ed >= st) {
            res.addLast(nums[ed]);
            ed--;
        }
        return res;
    }
}
